package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 物料产品bom表
 * @TableName product_bom
 */
@TableName(value ="product_bom")
@Data
public class ProductBom implements Serializable {
    /**
     * BOM编号
     */
    @TableId(type = IdType.AUTO)
    private Integer bomId;

    /**
     * BOM物料产品编号
     */
    private Integer bomMaterialId;

    /**
     * BOM物料产品编码
     */
    private String bomMaterialCode;

    /**
     * BOM物料产品名称
     */
    private String bomMaterialName;

    /**
     * 规格
     */
    private String bomMaterialSpec;

    /**
     * 单位
     */
    private String bomUnit;

    /**
     * 物料产品标识(1: 产品, 0: 物料)
     */
    private String bomMaterial;

    /**
     * 使用比例
     */
    private Integer quantity;

    /**
     * 是否启用 (1: 启用, 0: 禁用)
     */
    private Integer status;

    /**
     * 备注信息
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductBom other = (ProductBom) that;
        return (this.getBomId() == null ? other.getBomId() == null : this.getBomId().equals(other.getBomId()))
            && (this.getBomMaterialId() == null ? other.getBomMaterialId() == null : this.getBomMaterialId().equals(other.getBomMaterialId()))
            && (this.getBomMaterialCode() == null ? other.getBomMaterialCode() == null : this.getBomMaterialCode().equals(other.getBomMaterialCode()))
            && (this.getBomMaterialName() == null ? other.getBomMaterialName() == null : this.getBomMaterialName().equals(other.getBomMaterialName()))
            && (this.getBomMaterialSpec() == null ? other.getBomMaterialSpec() == null : this.getBomMaterialSpec().equals(other.getBomMaterialSpec()))
            && (this.getBomUnit() == null ? other.getBomUnit() == null : this.getBomUnit().equals(other.getBomUnit()))
            && (this.getBomMaterial() == null ? other.getBomMaterial() == null : this.getBomMaterial().equals(other.getBomMaterial()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBomId() == null) ? 0 : getBomId().hashCode());
        result = prime * result + ((getBomMaterialId() == null) ? 0 : getBomMaterialId().hashCode());
        result = prime * result + ((getBomMaterialCode() == null) ? 0 : getBomMaterialCode().hashCode());
        result = prime * result + ((getBomMaterialName() == null) ? 0 : getBomMaterialName().hashCode());
        result = prime * result + ((getBomMaterialSpec() == null) ? 0 : getBomMaterialSpec().hashCode());
        result = prime * result + ((getBomUnit() == null) ? 0 : getBomUnit().hashCode());
        result = prime * result + ((getBomMaterial() == null) ? 0 : getBomMaterial().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bomId=").append(bomId);
        sb.append(", bomMaterialId=").append(bomMaterialId);
        sb.append(", bomMaterialCode=").append(bomMaterialCode);
        sb.append(", bomMaterialName=").append(bomMaterialName);
        sb.append(", bomMaterialSpec=").append(bomMaterialSpec);
        sb.append(", bomUnit=").append(bomUnit);
        sb.append(", bomMaterial=").append(bomMaterial);
        sb.append(", quantity=").append(quantity);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}